﻿using System.IO;
using Styx;
using Styx.Helpers;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.Common;
using Styx.Common.Helpers;
using System.Windows.Forms;
using System.Reflection;

namespace KingWoW
{
    [Obfuscation(Exclude = true)] 
    public class ShadowPriestSettings : Settings
    {
        public static ShadowPriestSettings Instance = new ShadowPriestSettings();


        public string path_name = Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/ShadowPriest/ShadowPriest-Settings-{0}.xml", StyxWoW.Me.SafeName));

        public ShadowPriestSettings()
            : base(Path.Combine(Styx.Common.Utilities.AssemblyDirectory, string.Format(@"KingWOWCurrentSettings/ShadowPriest/ShadowPriest-Settings-{0}.xml", StyxWoW.Me.SafeName)))
        {
        }

        [Setting]
        [DefaultValue(false)]
        [Category("MOVEMENT")]
        [DisplayName("Auto Move")]
        [Description("Enable/disable CC movement")]
        public bool movementEnabled { get; set; }

        [Setting]
        [DefaultValue(28)]
        [Category("PULL")]
        [DisplayName("PullDistance")]
        [Description("Distance to pull from")]
        public float PullDistance { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("PULL")]
        [DisplayName("fastPull")]
        [Description("Fast Pull with sw:pain")]
        public bool fastPull { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Auto PW:Fortitude")]
        [Description("Cast Automaticaly PW:Fortitude on party")]
        public bool AutoPWFortitude { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("PRAYER OF MENDING")]
        [DisplayName("Use Preyer of Mending")]
        [Description("Enable/Disable Preyer of Mending")]
        public bool Use_PoM { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("Use talent for speed on moving")]
        [Description("chose to use AngelicFaether/PW:Shield if talented and if moving in combat or when MoveTimeForSpeedBuff condition OutOfCombat is verified")]
        public bool BurstSpeedMoving { get; set; }

        [Setting]
        [DefaultValue(500)]
        [Category("MOVEMENT")]
        [DisplayName("MoveTimeForSpeedBuff")]
        [Description("If OutOfCombat will cast movement spell buff if you move without changing direction for a time greater than this value in Milliseconds")]
        public int MoveTimeForSpeedBuff { get; set; }
        

        [Setting]
        [DefaultValue(true)]
        [Category("BUFF")]
        [DisplayName("Use Fade")]
        [Description("chose to use fade on aggro")]
        public bool UseFade { get; set; }
        
        [Setting]
        [DefaultValue(false)]
        [Category("DISPELLS")]
        [DisplayName("UseMassDispell ")]
        [Description("Use MassDispell for cure disease and dispell magic on many players")]
        public bool UseMassDispell { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("DISPELLS")]
        [DisplayName("Mass Dispell Count")]
        [Description("Set number of dispellable players for Mass Dispell")]
        public int MassDispellCount { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("Use Resurrection")]
        [Description("enable use of Resurrection out of combat")]
        public bool UseResurrection { get; set; }
        
        [Setting]
        [DefaultValue(true)]
        [Category("HEAL TUNING")]
        [DisplayName("use OOC healing")]
        [Description("enable-disable use of OutOfCombat healing")]
        public bool OOCHealing { get; set; }

        [Setting]
        [DefaultValue(90)]
        [Category("HEAL TUNING")]
        [DisplayName("HP until heal")]
        [Description("try heal me until reached this value of HP")]
        public int OOCHealingHP { get; set; }
        

        [Setting]
        [DefaultValue(false)]
        [Category("BUFF")]
        [DisplayName("Use Fear Ward")]
        [Description("enable use of Fear Ward on CD")]
        public bool UseFearWard { get; set; }      

        [Setting]
        [DefaultValue(15)]
        [Category("DISPERSION")]
        [DisplayName("Use Dispersion at hp%")]
        [Description("Use Dispersion at hp%")]
        public int DispersionHP { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("SPECIAL")]
        [DisplayName("AutoDismountOnCombat")]
        [Description("Auto start combat rotation when in combat and mounted")]
        public bool AutoDismountOnCombat { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("DOT_WEAVING_ROTATION")]
        [DisplayName("EnableDotWeavingRotation")]
        [Description("EnableDotWeavingRotation if clarity talent is selected!")]
        public bool EnableDotWeavingRotation { get; set; }
        

        [Setting]
        [DefaultValue(65)]
        [Category("VAMPIRIC EMBRANCE")]
        [DisplayName("VampiricEmbranceHP")]
        [Description("Use Vampiric Embrance if my HP or VampiricEmbranceNumber players below this value")]
        public int VampiricEmbranceHP { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("VAMPIRIC EMBRANCE")]
        [DisplayName("VampiricEmbranceNumber")]
        [Description("Use Vampiric Embrance players with HP <= VampiricEmbranceHP equal or greater this value")]
        public int VampiricEmbranceNumber { get; set; }

        [Setting]
        [DefaultValue(50)]
        [Category("SHIELDS")]
        [DisplayName("PW: Shield hp%")]
        [Description("Cast PW: Shield on Player at % hp")]
        public int PWShieldPercent { get; set; }

        //HEALING TUNING
        [Setting]
        [DefaultValue(30)]
        [Category("HEAL TUNING")]
        [DisplayName("Flash Heal hp%")]
        [Description("Cast Flash Heal at AttackTarget % hp")]
        public int FlashHealPercent { get; set; }

        [Setting]
        [DefaultValue(40)]
        [Category("CD")]
        [DisplayName("Desperate Prayer hp%")]
        [Description("Cast Desperate Prayer if we lower than % hp")]
        public int DesperatePrayerPercent { get; set; }

        public enum PowerInfusionUseType
        {
            COOLDOWN,
            BOSS,
            MANUAL
        }

        [Setting]
        [DefaultValue(PowerInfusionUseType.BOSS)]
        [Category("CD")]
        [DisplayName("Power Infusion use")]
        [Description("Cast Power Infusion on BOSS on COOLDOWN or MANUAL type")]
        public PowerInfusionUseType PowerInfusionUse { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("AOE DPS")]
        [DisplayName("Cascade/halo/DivineStar enemies number")]
        [Description("Cast Cascade/halo/DivineStar if enemyes in range respective spell >= this value")]
        public int CascadeHaloDivineStarNumber { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("AOE DPS")]
        [DisplayName("AvoidAOESpells")]
        [Description("Try to avoid AOE spells ")]
        public bool AvoidAOE { get; set; }     

        [Setting]
        [DefaultValue(20)]
        [Category("REST")]
        [DisplayName("Drink mana%")]
        [Description("Drink at % mana")]
        public int ManaPercent { get; set; }

        [Setting]
        [DefaultValue(0)]
        [Category("REST")]
        [DisplayName("Eat hp%")]
        [Description("Eat at % hp")]
        public int HealthPercent { get; set; }

        [Setting]
        [DefaultValue(0)]
        [Category("TANK")]
        [DisplayName("PW: Shield on OffTank hp%")]
        [Description("Cast PW: Shield on OffTank at % hp set to 100 for always up shield on tank")]
        public int OffTankShieldPercent { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CC")]
        [DisplayName("UsePsychicScream")]
        [Description("Use Psychic scream if enemy in range")]
        public bool UsePsychicScream { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CC")]
        [DisplayName("Do not Attack CrowdControlled enemy")]
        [Description("Do not Attack CrowdControlled enemy NB: may slow performance!")]
        public bool AvoidCC { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CC")]
        [DisplayName("UseVoidTendrils")]
        [Description("Use Void Tendrils if enemy in range")]
        public bool UseVoidTendrils { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("CC")]
        [DisplayName("UsePsyfiend")]
        [Description("Use Psyfiend if enemy in range")]
        public bool UsePsyfiend { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("DISPELL")]
        [DisplayName("UseDispellMagic")]
        [Description("UseDispellMagic on current AttackTarget: NB no logic implemented, so CC will dispell all dispellable aura")]
        public bool UseDispellMagic { get; set; }

        public enum TargetType
        {
            MANUAL,
            AUTO
        }

        [Setting]
        [DefaultValue(true)]
        [Category("MOVEMENT")]
        [DisplayName("AutoFacingTarget")]
        [Description("Enable/Disable autofacing current AttackTarget")]
        public bool AutofaceTarget { get; set; }

        [Setting]
        [DefaultValue(TargetType.AUTO)]
        [Category("TARGETTING")]
        [DisplayName("TargetTypeSelected")]
        [Description("AUTO/MANUAL enable/disable autotargeting SEMIAUTO: same logic of AUTO but no switch selected AttackTarget")]
        public TargetType TargetTypeSelected { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("MULTIDOT")]
        [DisplayName("Multidot_SW_Pain_EnemyNumberMin")]
        [Description("Enable Multidot of ShadowWord: Pain rotation if Enemy in range withouut this dot >= this value")]
        public int Multidot_SW_Pain_EnemyNumberMin { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("MULTIDOT")]
        [DisplayName("Multidot_SW_Pain_EnemyNumberMax")]
        [Description("Disable Multidot rotation if dotted Enemy with ShadowWors: Pain> this value")]
        public int Multidot_SW_Pain_EnemyNumberMax { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("MULTIDOT")]
        [DisplayName("Multidot_VampiricTouch_EnemyNumberMin")]
        [Description("Enable Multidot of VampiricTouch rotation if Enemy in range withouut this dot >= this value")]
        public int Multidot_VampiricTouch_EnemyNumberMin { get; set; }

        [Setting]
        [DefaultValue(2)]
        [Category("MULTIDOT")]
        [DisplayName("Multidot_VampiricTouch_EnemyNumberMax")]
        [Description("Disable Multidot rotation if dotted Enemy with VampiricTouch > this value")]
        public int Multidot_VampiricTouch_EnemyNumberMax { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("MULTIDOT")]
        [DisplayName("Enable Multidot Rotation")]
        [Description("Enable/Disable use of Multidot rotation")]
        public bool MultidotEnabled { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("MULTIDOT")]
        [DisplayName("Avoid Crowd Controlled in Multidot Rotation")]
        [Description("Avoid Crowd Controlled in Multidot Rotation")]
        public bool MultidotAvoidCC { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("INTERRUPT")]
        [DisplayName("autointerrupt")]
        [Description("Cast counterspell if AttackTarget casting and interrumpible")]
        public bool AutoInterrupt { get; set; }

        [Setting]
        [DefaultValue(200)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MIN_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MIN_Time { get; set; }

        [Setting]
        [DefaultValue(500)]
        [Category("INTERRUPT")]
        [DisplayName("Interrupt_MAX_Time")]
        [Description("Interrupt if enemy cast time between Interrupt_MIN_Time and Interrupt_MAX_Time")]
        public int Interrupt_MAX_Time { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("AOE DPS")]
        [DisplayName("Use Mind Sear EnemyNumberMin")]
        [Description("Use Mind Sear if enemies around Tank or OffTank > this value")]
        public int MindSearEnemyNumberMin { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE DPS")]
        [DisplayName("Use Mind Sear")]
        [Description("Enable/Disable use of MindSear")]
        public bool UseMindSear { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE DPS")]
        [DisplayName("UseCascade/Halo/DivineStar")]
        [Description("Enable/Disable use of Cascade/Halo/DivineStar")]
        public bool Use_Halo_Cascade_Divine { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("AOE DPS")]
        [DisplayName("MindSearAlsoOnEnemies")]
        [Description("use of MindSear olso on current enemy AttackTarget if condition verified")]
        public bool MindSearAlsoOnEnemies { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("PauseKey")]
        [Description("enable/disable Routine")]
        public Keys PauseKey { get; set; }

        [Setting, DefaultValue(Keys.None)]
        [Category("HOTKEY")]
        [DisplayName("MassDispellOnHotkey")]
        [Description("Cast Mass Dispell On mouse position")]
        public Keys MassDispellOnHotkey { get; set; }

    }
}